import fetch from 'common/src/utils/fetch'
//获取异动大类带分页
export function getStatusCategories(data = {}) {
    return fetch({
        url: '/api/studentservice/abnormalclass/abnormalClassList',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}
// 获取异动大类不带分页
export async function getStatusCategoriesNoPage() {
    return fetch({
        url: '/api/studentservice/abnormalclass/listNoPage',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data: {}
    })
}
// 添加异动大类
export function addStatusCategory(data = {}) {
    return fetch({
        url: '/api/studentservice/abnormalclass/addAbnormalClass',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}
//删除异动大类
export function deleteStatusCategory(data = {}) {
    return fetch({
        url: `/api/studentservice/abnormalclass/deleteAbnormalClass?id=${data.id}`,
        method: 'delete',
        headers: { 'Content-Type': 'application/json' },
    })
}
//修改异动大类
export function editStatusCategory(data = {}) {
    return fetch({
        url: '/api/studentservice/abnormalclass/updateAbnormalClass',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}
//判断大类中文名称是否重复
export function isExistCategory(data = {}) {
    return fetch({
        url: `/api/studentservice/abnormalclass/isExist?name=${data.name}`,
        method: 'get',
        headers: { 'Content-Type': 'application/json' }
    })
}
//查询异动类型扩展列表
export function getStatusCategoryExts(data = {}) {
    return fetch({
        url: '/api/studentservice/type/typeList',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}
//查询所有异动类型
export function getTypeListNOPage(data = {}) {
    return fetch({
        url: '/api/studentservice/type/typeList',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}
// 异动统计
export function getAbnormalStatistics(data = {}) {
    return fetch({
        url: '/api/studentservice/type/typeList',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}
//新增异动大类扩展基本信息
export function addStatusCategoryBasic(data = {}) {
    return fetch({
        url: '/api/studentservice/type/addType',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}
// 修改异动大类扩展基本信息
export function editStatusCategoryBasic(data = {}) {
    return fetch({
        url: '/api/studentservice/type/updateType',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}
//修改异动类型扩展
export function editStatusCategoryExt(data = {}) {
    return fetch({
        url: '',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}
//删除异动类型扩展
export function deleteStatusCategoryExt(id = '') {
    return fetch({
        url: `/api/studentservice/type/deleteType?id=${id}`,
        method: 'delete',
        headers: { 'Content-Type': 'application/json' }
    })
}
// 判断异动类型名字是否存在
export function isExistTypeName(data = {}) {
    return fetch({
        url: `/api/studentservice/type/isNameExist?name=${data.name}`,
        method: 'get',
        headers: { 'Content-Type': 'application/json' },
    })
}
//判断异动原因是否存在
export function checkNameExist(name = '') {
    return fetch({
        url: `/api/studentservice/reason/isNameExist?name=${name}`,
        method: 'get',
        headers: { 'Content-Type': 'application/json' },
    })
}
//添加异动原因
export function addReason(data = {}) {
    return fetch({
        url: '/api/studentservice/reason/addReason',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}
// 修改异动原因
export function editReason(data = {}) {
    return fetch({
        url: '/api/studentservice/reason/updateReason',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}
// 删除异动原因
export function deleteReason(data = []) {
    return fetch({
        url: '/api/studentservice/reason/deleteReason',
        method: 'delete',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}
// 获取异动原因
export function getReasons(data = {}) {
    return fetch({
        url: '/api/studentservice/reason/reasonList',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}
//获取字段显示列表数据
export function getFields() {
    return fetch({
        url: '/api/studentservice/field/fieldNameList',
        method: 'get',
        headers: { 'Content-Type': 'application/json' },
    })
}
export function getSetedFields(typeId) {
    return fetch({
        url: `/api/studentservice/field/fieldStatusList?typeId=${typeId}`,
        method: 'get',
        headers: { 'Content-Type': 'application/json' },
    })
}
// 更新字段
export function updateFields(data = []) {
    return fetch({
        url: '/api/studentservice/field/updateStatusList',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}